package lt.liepasoft.sudoku;

import android.app.Activity;
import android.os.Bundle;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;

import com.example.liepa_sudoku_android.R;

public class SudokuActivity extends Activity {

	public static int 
		gameWidth, gameHeight;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Display d = getWindowManager().getDefaultDisplay();
        gameWidth = d.getWidth();
        gameHeight = d.getHeight();
        setContentView(R.layout.sudoku_activity_layout);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_sudoku, menu);
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	SudokuView v = (SudokuView)findViewById(R.id.sudokuView1);
        // Handle item selection
        switch (item.getItemId()) {
            case R.id.solve_puzzle:
                v.solveGame();
                return true;
            case R.id.new_game:
                v.newGame();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    
}
